package reflect;

import reflect.annotations.AutoRunClass;

import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个类的完全限定名");
        String className=sc.nextLine();
        Class cla=Class.forName(className);


        if (cla.isAnnotationPresent(AutoRunClass.class)){
            Object obj=cla.newInstance();
            System.out.println(obj);
        }else {
            System.out.println("该类没有被标记");
        }



    }
}
